package xyz.huangziheng.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xyz.huangziheng.entity.Department;
import xyz.huangziheng.utli.DepartmentPage;

import java.util.List;

@Repository
public interface DepartmentMapper {

    /**
     * 查询全部
     *
     * @return 所有数据
     */
    List<Department> findAll();

    /**
     * 查询一条
     *
     * @param id
     * @return 一条数据
     */
    Department findById(Long id);

    /**
     * 删除数据
     *
     * @param id
     * @return
     */
    boolean getDelete(Long id);

    /**
     * 更新数据
     *
     * @param department
     * @return 是否成功
     */
    boolean getUpdate(Department department);

    /**
     * 添加数据
     *
     * @param department
     * @return
     */
    boolean getInset(Department department);

    /**
     * 分页
     *
     * @return
     */
    List<Department> getPagination(DepartmentPage page);

    /**
     * 总条数
     *
     * @return
     */
    Integer getTotalNumber(DepartmentPage page);

}
